import { Button, Typography } from 'antd';
import type { FC, ReactNode } from 'react';
import { memo } from 'react';
import { useNavigate } from 'react-router-dom';
import { LOGIN_PATH } from '@/router';
import styles from './Home.module.scss';

interface IProps {
  children?: ReactNode;
}

const { Title, Paragraph } = Typography;

const Home: FC<IProps> = () => {
  const navigate = useNavigate();

  return (
    <div className={styles.container}>
      {/*   <Button onClick={toLogin}>登录</Button>
      <Link to="/register">注册</Link> */}
      <div className={styles.info}>
        <Title>问卷调查 | 在线投票</Title>
        <Paragraph>已累计创建问卷100份，发布问卷90份，收到答卷900份</Paragraph>
        <div>
          <Button type="primary" onClick={() => navigate(LOGIN_PATH)}>
            开始使用
          </Button>
        </div>
      </div>
    </div>
  );
};

export default memo(Home);
